<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="../js/vue-router.min.js"></script>

</head>
<body>
<div id="app">
    <router-link to="/user">User</router-link>
    <router-link to="/login">Login</router-link>

    <router-view></router-view>
</div>
<script type="text/javascript">
    var User = { template:"<div>This is User</div>" }
    var Login = { template:"<div>This is Login</div>" }

    var router=new VueRouter({
        routes:[
            { path:"/",redirect:"/user"},
            {path:'/user',component:User},
            {path:'/login',component:Login},
        ]
    })

    var vm=new Vue({
        el:'#app',
        router
    })

</script>
</body>
</html>